﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetCSharp
{
    public partial class FuxiType
    {
        void MakeRiverDecision()
        {
            switch (strategy)
            {
                case Strategy.Basic:
                    if (winOdds > 0.94 ||
                         (winOdds > 0.91 || winOdds > 0.88 && loseOdds < 0.05) && _handData.NumFuxiRaisedRiver == 0 ||
                        _handData.HavePosition && _handData.NumOppRaisedTurn == 0 && _handData.NumOppRaisedRiver == 0 && winOdds > 0.75 ||
                        !_handData.HavePosition && _handData.NumOppRaisedTurn == 0 && _handData.NumOppRaisedRiver == 0 && winOdds > 0.80
                       )

                    {
                        _handData.NumFuxiRaisedRiver++;
                        ExecuteRaise();
                    }
                    else if (_handData.HavePosition && _handData.NumFuxiRaisedRiver == 0 && winOdds > 0.66 ||
                            _handData.HavePosition && _handData.NumFuxiRaisedRiver == 1 && winOdds > 0.70 ||
                            loseOdds < 0.2)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                case Strategy.Trap:
                    if (!_riverCheckRaise &&
                        (winOdds > 0.94 ||
                        (winOdds > 0.91 || winOdds > 0.88 && loseOdds < 0.05) && _handData.NumFuxiRaisedRiver == 0 ||
                        _handData.HavePosition && _handData.NumOppRaisedTurn == 0 && _handData.NumOppRaisedRiver == 0 && winOdds > 0.82 ||
                        !_handData.HavePosition && _handData.NumOppRaisedTurn == 0 && _handData.NumOppRaisedRiver == 0 && winOdds > 0.87
                       )
                        )
                    {
                        _handData.NumFuxiRaisedRiver++;
                        ExecuteRaise();
                    }
                    else if (winOdds > potOdds ||
                            loseOdds < 0.2)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                default:
                    break;
            }

        }
    }
}
